//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//  This file is part of the buola project (https://code.google.com/p/buola/).  //
//                                                                              //
//  Copyright(c) 2007-2012 Xavi Gratal                                          //
//  gratal AT gmail DOT com                                                     //
//                                                                              //
//  Buola is free software: you can redistribute it and/or modify               //
//  it under the terms of the GNU General Public License as published by        //
//  the Free Software Foundation, either version 3 of the License, or           //
//  (at your option) any later version.                                         //
//                                                                              //
//  Buola is distributed in the hope that it will be useful,                    //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of              //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               //
//  GNU General Public License for more details.                                //
//                                                                              //
//  You should have received a copy of the GNU General Public License           //
//  along with buola.  If not, see <http://www.gnu.org/licenses/>.              //
//                                                                              //
//////////////////////////////////////////////////////////////////////////////////

#ifndef _BUOLA_SCENE_IMPORT_VRML_ENUMS_H_
#define _BUOLA_SCENE_IMPORT_VRML_ENUMS_H_

#include <buola/buola.h>

namespace buola { namespace scene { namespace vrml {

enum ETokenizeResult
{
    TOKENIZE_OK,
    TOKENIZE_ERROR,
    TOKENIZE_EMPTY,
};

enum EParseResult
{
    PARSE_OK,
    PARSE_INCOMPLETE,
    PARSE_STRING_ERROR,
    PARSE_ERROR,
    PARSE_EMPTY
};

enum ETokenType
{
    TOKENTYPE_WHITESPACE=0x100,
    TOKENTYPE_NUMBER=0x200,
    TOKENTYPE_KEYWORD=0x400,
    TOKENTYPE_FIELDTYPE=0x800,
    TOKENTYPE_KW_EVENT=0x1000,
    TOKENTYPE_KW_FIELD=0x2000,
    TOKENTYPE_KW_EVENTORFIELD=TOKENTYPE_KW_EVENT|TOKENTYPE_KW_FIELD,
    TOKENTYPE_STRING=0x800000,
};
DECLARE_ENUM_BITOPS(ETokenType)

enum EToken
{
    TOKEN_INVALID=0,
    //whitespace
    TOKEN_SPACE=2|TOKENTYPE_WHITESPACE,
    TOKEN_COMMENT=3|TOKENTYPE_WHITESPACE,
    //literals
    TOKEN_INTEGER=8|TOKENTYPE_NUMBER,
    TOKEN_FLOAT=9|TOKENTYPE_NUMBER,
    TOKEN_STRING=10|TOKENTYPE_STRING,
    TOKEN_INCOMPLETESTRING=17,
    TOKEN_INCOMPLETENUMBER=18,
    //VRML keywords
    TOKEN_KW_DEF=23|TOKENTYPE_KEYWORD,
    TOKEN_KW_EXTERNPROTO=24|TOKENTYPE_KEYWORD,
    TOKEN_KW_FALSE=25|TOKENTYPE_KEYWORD,
    TOKEN_KW_IS=26|TOKENTYPE_KEYWORD,
    TOKEN_KW_NULL=27|TOKENTYPE_KEYWORD,
    TOKEN_KW_PROTO=28|TOKENTYPE_KEYWORD,
    TOKEN_KW_ROUTE=29|TOKENTYPE_KEYWORD,
    TOKEN_KW_TO=30|TOKENTYPE_KEYWORD,
    TOKEN_KW_TRUE=31|TOKENTYPE_KEYWORD,
    TOKEN_KW_USE=32|TOKENTYPE_KEYWORD,
    TOKEN_KW_EVENTIN=33|TOKENTYPE_KEYWORD|TOKENTYPE_KW_EVENT,
    TOKEN_KW_EVENTOUT=34|TOKENTYPE_KEYWORD|TOKENTYPE_KW_EVENT,
    TOKEN_KW_EXPOSEDFIELD=35|TOKENTYPE_KEYWORD|TOKENTYPE_KW_FIELD,
    TOKEN_KW_FIELD=36|TOKENTYPE_KEYWORD|TOKENTYPE_KW_FIELD,
    TOKEN_KW_SCRIPT=57|TOKENTYPE_KEYWORD,
    //VRML types
    TOKEN_FT_MFCOLOR=37|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFFLOAT=38|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFINT32=39|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFNODE=40|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFROTATION=41|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFSTRING=42|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFTIME=43|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFVEC2F=44|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_MFVEC3F=45|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFBOOL=46|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFCOLOR=47|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFFLOAT=48|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFIMAGE=49|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFINT32=50|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFNODE=51|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFROTATION=52|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFSTRING=53|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFTIME=54|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFVEC2F=55|TOKENTYPE_FIELDTYPE,
    TOKEN_FT_SFVEC3F=56|TOKENTYPE_FIELDTYPE,
    //enclosers
    TOKEN_LEFT_SQUARE=64,
    TOKEN_RIGHT_SQUARE=65,
    TOKEN_LEFT_BRACE=67,
    TOKEN_RIGHT_BRACE=68,
    //python operators
    TOKEN_PERIOD=70,
    //generic identifier or word part
    TOKEN_IDENTIFIER=122,

    TOKEN_EOI=127,
};

/*namespace vrml */ } /*namespace scene*/ } /*namespace buola*/ }

#endif
